package com.suixinsanren.design.adapter.demo03;

import org.junit.Test;

public class AdapterTestDrive {

    @Test
    public void testOne() {
        Duck duck = new WildDuck();
        Turkey blackTurkey = new BlackTurkey();

        testDuck(duck);
        testTurkey(blackTurkey);
    }

    @Test
    public void testTwo() {
        Duck duck = new WildDuck();
        Turkey blackTurkey = new BlackTurkey();

        testDuck(new BirdAdapter(blackTurkey));
        testTurkey(new BirdAdapter(duck));
    }


    public void testDuck(Duck duck) {
        duck.quack();
        duck.fly();
    }

    public void testTurkey(Turkey turkey) {
        turkey.gobble();
        turkey.fly();
    }
}
